<a href="<?php echo( base_url() ); ?>cmb/member_reports/download_balavihar_all_class_assignment_report/<?php echo( $urlKey ); ?>/" target="_self">Download Data</a>
<?php
	Includes::IncludeFile( Includes::$FORM );
	Includes::IncludeFile( Includes::$SPACER );
	
	$curdatetime = time();
	
	$curdate = date('l, F jS, Y', $curdatetime);
	Form::OpenFormItemSummary('Date:', 50);
		echo( form_label($curdate, 'numrecs', 'style="width: 50px;" ') );
	Form::CloseFormItem();

	$curtime = date('h:i:s A', $curdatetime);
	Form::OpenFormItemSummary('Time:', 50);
		echo( form_label($curtime, 'numrecs', 'style="width: 50px;" ') );
	Form::CloseFormItem();

	Form::OpenFormItemSummary('School Year:', 260);
		echo( form_label($year.'-'.($year+1), 'numrecs', 'style="width: 20px;" ') );
	Form::CloseFormItem();
	
    $numreg = 0;
    $numunreg = 0;
    $numtot = 0;
	if (count($bvinfo) > 0)
	{
        foreach( $bvinfo as $bvrec)
        {            
            if ($bvrec['fully_paid'] == "Unregistered")
                $numunreg ++;
            else
                $numreg ++;
        }
        
        $numtot = $numreg + $numunreg;
	}
    
    Form::OpenFormItemSummary('Number registered students:', 260);
        echo( form_label($numreg, 'numrecs', 'style="width: 20px;" ') );
    Form::CloseFormItem();
    	
    Form::OpenFormItemSummary('Number unregistered students:', 260);
        echo( form_label($numunreg, 'numrecs', 'style="width: 20px;" ') );
    Form::CloseFormItem();
        
	echo('<hr style="width:50%; size:10; color:#0000FF;" align="left" />');
	
	Spacer::Render(0, 20);	
?>
<table border="1">
	<?php
		if (count($bvinfo) > 0)
		{
			$i = 0;
			echo('<th><center><b>&nbspSeq#&nbsp</b></center></th>');
			echo('<th><center><b>&nbspHH_ID&nbsp</b></center></th>');
			echo('<th><center><b>&nbspCenter&nbspName&nbsp</b></center></th>');
            echo('<th><center><b>&nbspSession&nbsp</b></center></th>');
            echo('<th><center><b>&nbspGrade&nbsp</b></center></th>');
            echo('<th><center><b>&nbspLanguage&nbsp</b></center></th>');
            echo('<th><center><b>&nbspFirst&nbspName&nbsp</b></center></th>');
			echo('<th><center><b>&nbspLast&nbspName&nbsp</b></center></th>');
			echo('<th><center><b>&nbspDOB&nbsp</b></center></th>');
			echo('<th><center><b>&nbspCity&nbsp</b></center></th>');
			echo('<th><center><b>&nbspState&nbsp</b></center></th>');
			echo('<th><center><b>&nbspParent&nbspName&nbsp</b></center></th>');
			echo('<th><center><b>&nbspPhone#&nbsp</b></center></th>');
			echo('<th><center><b>&nbspParent&nbspEmail&nbsp</b></center></th>');
			echo('<th><center><b>&nbspChild&nbspEmail&nbsp</b></center></th>');
			echo('<th><center><b>&nbspPay&nbspStatus&nbsp</b></center></th>');

			foreach( $bvinfo as $bvrec)
			{
				if ($i % 2 != 0)
				{
					$rowColor = "#e0ffff";
				}
				else
				{
					$rowColor = "#ffffff";
				}
				
				if ($bvrec['fully_paid'] == "Unregistered")
                    echo('<tr bgcolor="'.$rowColor.'"><td><font color="red"><center>'.($i+1).'</center></font></td><td><center><font color="red">'.$bvrec['household_id'].'</center></font></td><td><center><font color="red">'.$bvrec['centername'].'</center></font></td><td><center><font color="red">'.$bvrec['session'].'</center></font></td><td><center><font color="red">'.$bvrec['gradename'].'</center></font></td><td><center><font color="red">'.$bvrec['language'].'</center></font></td><td><center><font color="red">'.$bvrec['firstname'].'</center></font></td><td><center><font color="red">'.$bvrec['lastname'].'</center></font></td><td><center><font color="red">'.$bvrec['birth_date'].'</center></font></td><td><center><font color="red">'.$bvrec['city'].'</center></font></td><td><center><font color="red">'.$bvrec['state'].'</center></font></td><td><center><font color="red">'.$bvrec['parent_name'].'</center></font></td><td><center><font color="red">'.$bvrec['parent_phone'].'</center></font></td><td><center><font color="red">'.$bvrec['parent_email'].'</center></font></td><td><center><font color="red">'.$bvrec['child_email'].'</center></font></td><td><center><font color="red">'.$bvrec['fully_paid'].'</center></font></td></tr>');
				else
					echo('<tr bgcolor="'.$rowColor.'"><td><center>'.($i+1).'</center></td><td><center>'.$bvrec['household_id'].'</center></td><td><center>'.$bvrec['centername'].'</center></td><td><center>'.$bvrec['session'].'</center></td><td><center>'.$bvrec['gradename'].'</center></td><td><center>'.$bvrec['language'].'</center></td><td><center>'.$bvrec['firstname'].'</center></td><td><center>'.$bvrec['lastname'].'</center></td><td><center>'.$bvrec['birth_date'].'</center></td><td><center>'.$bvrec['city'].'</center></td><td><center>'.$bvrec['state'].'</center></td><td><center>'.$bvrec['parent_name'].'</center></td><td><center>'.$bvrec['parent_phone'].'</center></td><td><center>'.$bvrec['parent_email'].'</center></td><td><center>'.$bvrec['child_email'].'</center></td><td><center>'.$bvrec['fully_paid'].'</center></td></tr>');
							
				$i++;
			}
		}
		else
			echo "No results returned";
	?>
</table>
